﻿using System.Diagnostics;

public class LdBoolAstTree : LuaAstTree
{
    public int Value { get; }
    public LdBoolAstTree(int value)
    {
        Value = value;
        ResultType = ObjectKind.Boolean;
    }
    public override void WriteTo(ICodeWriter writer)
    {
        Debug.Assert(Value == 0 || Value == 1, "未知的布尔类型值！");
        writer.Code(Value == 0 ? "false" : "true");
    }
}